Skip to content

Making x64 hello sample position independent#26

Open
Caesurus wants to merge 9 commits into
lunixbochs:masterfrom
Caesurus:master
Open

Making x64 hello sample position independent#26
Caesurus wants to merge 9 commits into
lunixbochs:masterfrom
Caesurus:master

Conversation

@Caesurus

@Caesurus Caesurus commented Apr 7, 2018

Copy link
Copy Markdown

I tested this with the PIE binary that I've been working with and with a standard binary like ls

@lunixbochs

Copy link
Copy Markdown
Owner

0x19+size seems wrong, maybe it should still be hello, then do %#x-rip?

@lunixbochs

lunixbochs commented Apr 8, 2018

Copy link
Copy Markdown
Owner

memcpy PIE is done here with the magic _PKST_ label: https://github.com/lunixbochs/patchkit/blob/master/core/arch.py#L73

@Caesurus

Caesurus commented Apr 10, 2018

Copy link
Copy Markdown
Author

That's exactly what I was looking for. Updated as you suggested, looks much better.
Tested with PIE and standard ls binary

It is a shame that the hello variable isn't used though, it's nice to see that inject returns that address and how to use it. Maybe it's good to have this as a separate example, hello64_pie.py?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants